import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { UserEntity } from 'src/modules/user/entities/user.entity';

export class CreateBlogDto {
  @ApiProperty({
    type: String,
    description: '标题',
    default: '第一篇博客',
  })
  readonly title: string;

  @ApiProperty({
    type: String,
    description: '内容',
    default: '# 博客内容',
  })
  readonly content: string;

  @ApiPropertyOptional({
    type: Array,
    description: '关键字',
    default: ['demo'],
  })
  readonly keyword: [];

  @ApiPropertyOptional({
    type: String,
    description: '描述',
    default: '这是我的第一篇博客',
  })
  readonly describe: string;

  @ApiPropertyOptional({
    type: String,
    description: '预览图',
    default: 'https://example.png',
  })
  readonly image: string;

  length: number;

  visited: number;

  @ApiPropertyOptional({
    type: String,
    description: '所有者id',
    default: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
  })
  readonly user: UserEntity;
}
